from multiprocessing.dummy import Pool
import time

def func(url):
    print('开始下载：',url)
    time.sleep(2)
    print('下载完成：',url)

if __name__ == "__main__":
    starttime = time.time()

    p = Pool(5)
    urls = ["www1","www2","www3","www4","www5"]
    p.map(func,urls)

    endtime = time.time()
    print(f"耗时:{endtime-starttime}")

    p.close()
